﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Web;
using System.Web.Mvc;
using AdvCMS.Models;

namespace AdvCMS.Controllers
{
    public class FileManagementController : Controller
    {
        //
        // GET: /FileManagement/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Index(UploadModel uploadModel,HttpPostedFileBase file)
        {

            if (file != null && file.ContentLength > 0)
            {
                string fileName = file.FileName;
                string path = Path.Combine(Server.MapPath("~/Data/"), fileName);
                file.SaveAs(path);
            }

            return View();
        }

    }
}
